#ifndef YINGCEWINDOW_H
#define YINGCEWINDOW_H

#include "libs/extension/extensiontype.h"
#include <QMainWindow>
#include <QPointer>

class HomeView;
class MainView;

class YingCeWindow : public QMainWindow
{
    Q_OBJECT
public:
    explicit YingCeWindow(QWidget* parent = nullptr);
    ~YingCeWindow();

    static YingCeWindow* instance() { return instance_; }

    // 注册用户
    void registerUser();
    void logout();
    void requestStop(const yc::ResolveCallback& resolve, const yc::RejectCallback& reject);

protected:
    void closeEvent(QCloseEvent* e) override;

private:
    void onLoginFinished();

    static YingCeWindow* instance_;
    QPointer<HomeView> home_view_;
    QPointer<MainView> main_view_;
};

#endif // YINGCEWINDOW_H
